use super::{MapSv, SvCache, VBase, VMap, ST_WAIT};

pub fn is_active(v: &MapSv, k: &str) -> bool {
    match v.k_bool(k) {
        Some(v) => v,
        None => false,
    }
}

pub fn get_state(id: &str, cache: &SvCache) -> i64 {
    match cache.get(id) {
        Some(v) => match v.ki64() {
            Some(t) => t,
            None => ST_WAIT,
        },
        None => ST_WAIT,
    }
}
